<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  
  <!-- import CSS -->
  <link rel="stylesheet" href="../../layuiadmin/element-ui/lib/theme-chalk/index.css">
  <!-- import Vue before Element -->
  <script src="../../layuiadmin/js/case/vue.js"></script>
  <!-- import JavaScript -->
  <script src="../../layuiadmin/element-ui/lib/index.js"></script>
  <!-- import vueResource -->
  <script type="text/javascript" src="../../layuiadmin/js/case/vue-resource.js"></script>
	<!--导入bootstrap-->
  <link href="../../layuiadmin/js/adm/css/bootstrap.css" rel="stylesheet">
  <script src="../../layuiadmin/js/adm/js/jquery.min.js"></script>
  <script src="../../layuiadmin/js/adm/js/bootstrap.js"></script>
  <script>Vue.config.productionTip=false</script>
  
  <style>
	  .table-border{
		  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
	  }
	  body{
		  background: #FFFFFF;
	  }
	  .select_class{
		  width: 80px;
		  height: 30px;
		  border-radius: 4px
	  }
	  .select_class option{
		  width: 80px;
	  }
	  .el-dropdown-link {
		  cursor: pointer;
		  color: #409EFF;
	  }
	  .el-icon-arrow-down {
		  font-size: 12px;
	  }
  </style>
</head>

<body>
	
  <div id="law">
	  <el-form style="margin-top: 20px" :inline="true" :model="Case_law" size="mini" class="demo-form-inline">

		  <el-form-item>
			  <el-input style="width: 150px;" v-model="Case_law.caseId" placeholder="请输入案件号"></el-input>
			  <el-input style="width: 150px;" v-model="Case_law.clientId.clientName" placeholder="请输入委托人名称"></el-input>

			  <el-select v-model="Case_law.caseStatus" placeholder="选择案件状态">
				  <el-option label="未结案" value="未结案"></el-option>
				  <el-option label="已结案" value="已结案"></el-option>
			  </el-select>

			  <!-- 
                  案件类型
                  props.label 显示值
                  props.value 选择值
                  props.children 子集
              -->
			  <el-cascader :options="case_type" :props="type_key" v-model="selectcaseTypeid"
						   placeholder="选择案件类型" clearable></el-cascader>

			  <el-select v-model="Case_law.closeState" placeholder="收案审批状态">
				  <el-option label="审批中" value="审批中"></el-option>
				  <el-option label="通过" value="审批通过"></el-option>
				  <el-option label="不通过" value="审批未通过"></el-option>
			  </el-select>

		  </el-form-item>

		  <el-form-item>
			  <el-button type="primary" @click="onSubmit">查询</el-button>
		  </el-form-item>

	  </el-form>

	  <el-table :data="tableData" style="width: 100%">

		  <el-table-column sortable prop="caseId" width="150px" label="案号">
			  <!--
                  scope 总数据
                  row 行对象 row.xx获取数据
                  scope.$index 获取行号
                  scope.row.caseId 案件号
              -->
			  <template slot-scope="scope">
				  <el-link type="primary" @click="queryByid(scope.row.caseId)">{{scope.row.caseId}}</el-link>
			  </template>

		  </el-table-column>

		  <el-table-column sortable prop="submitDate" label="创建时间">
		  </el-table-column>

		  <el-table-column prop="clientId.clientName" label="委托人">
		  </el-table-column>

		  <el-table-column prop="oppositeId.clientName" label="对方当事人">
		  </el-table-column>

		  <el-table-column prop="mainLawyer.empName" label="主办律师">
		  </el-table-column>

		  <el-table-column prop="caseTypeid.typeName" label="案件类型">
		  </el-table-column>

		  <el-table-column prop="caseStatus" label="案件状态">
		  </el-table-column>

		  <el-table-column prop="agencyMoney" label="代理费">
		  </el-table-column>

		  <el-table-column prop="realityMoney" label="实付金额">
		  </el-table-column>

		  <el-table-column prop="closeState" label="收案审批">
		  </el-table-column>

		  <el-table-column prop="closeMode" label="收案方式">
		  </el-table-column>

		  <el-table-column fixed="right" label="操作">
			  <template slot-scope="scope">
				  <el-dropdown>
							  <span class="el-dropdown-link">
							    选择操作<i class="el-icon-arrow-down el-icon--right"></i>
							  </span>
					  <el-dropdown-menu size="small" slot="dropdown" >

						  <el-dropdown-item @click.native="cost(scope.row.caseId)"
											v-if="scope.row.closeState !='不通过' && scope.row.agencyMoney != 0">
							  费用减免申请
						  </el-dropdown-item>

						  <el-dropdown-item @click.native="gathering(scope.row.caseId)"
											v-if="scope.row.closeState !='不通过' && scope.row.case_unpaidsal != 0 ">
							  添加收款记录
						  </el-dropdown-item>

						  <el-dropdown-item @click.native="closelaw(scope.row.caseId)" v-if="scope.row.closeState !='不通过' && scope.row.closeState =='通过' && scope.row.caseStatus!='已结案'  ">
							  结案
						  </el-dropdown-item>

						  <el-dropdown-item @click.native="invoice(scope.row.caseId)" v-if="scope.row.closeState !='不通过' && scope.row.closeState =='通过' ">
							  申请发票
						  </el-dropdown-item>

						  <el-dropdown-item @click.native="cost(scope.row.caseId)" v-if="scope.row.closeState =='不通过' ">
							  重新申请
						  </el-dropdown-item>

					  </el-dropdown-menu>
				  </el-dropdown>

			  </template>
		  </el-table-column>

	  </el-table>

	  <div class="block">
		  <!--@current-change 当点击切换页 的时候触发事件 
              page-size 每页显示
              total 总数
          -->
		  <el-pagination
				  @current-change="handleCurrentChange"
				  layout="total, prev, pager, next,jumper"
				  :page-size="5"
				  :total="10">
		  </el-pagination>
	  </div>

	  <!--
          :visible.sync="dialogVisible" 控制打开关闭
          :before-close="handleClose" 控制关闭的方法
      -->
	  <!--单条案件显示模态框 -->
	  <el-dialog title="案件详情信息" :visible.sync="dialogVisible" width="80%" :before-close="handleClose">
		  <table v-loading="law_loding" style="font-size: 14px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) " class="table-border" border="0px" width="1030px" height="300px">
			  <tr>
				  <td>案号：{{law.caseId}}</td>
				  <td>委托人：{{law.clientId.cname}}</td>
				  <td>对方当事人：{{law.oppositeId.cname}}</td>
				  <td>诉讼地位：{{law.locusStandi}}</td>
			  </tr>

			  <tr>
				  <td>案由：{{law.causeOfAction}}</td>
				  <td>案件冲突详情：{{law.causeDetails}}</td>
				  <td>案件状态：{{law.caseStatus}}</td>
				  <td>诉讼标的：{{law.objectOfAction}}</td>
			  </tr>

			  <tr>
				  <td>案件类型：{{law.caseTypeid.typeName}}</td>
				  <td>卷宗文件：{{law.recordFilename}}</td>
				  <td>提交人：{{law.submitId.user_name}}</td>
				  <td>提交时间：{{law.submitDate}}</td>
			  </tr>

			  <tr>
				  <td>承办律师：{{law.mainLawyer.empName}}</td>
				  <td>代理费用：{{law.agencyMoney}}</td>
				  <td>杂费：{{law.blendMoney}}</td>
				  <td>应付金额：{{law.amountMoney}}</td>
			  </tr>

			  <tr>
				  <td>受理法院：{{law.courtId.courtName}}</td>
				  <td>开庭时间：{{law.sessionDate}}</td>
				  <td>立庭日期：{{law.stateSessionDate}}</td>
				  <td>宣判日期：{{law.trialDate}}</td>
			  </tr>

			  <tr>
				  <td>收案审批状态：{{law.closeState}}</td>
				  <td>收案方式：{{law.closeMode}}</td>
				  <td>收案时间：{{law.closeDate}}</td>
				  <td>审批人：{{law.closeDate}}</td>
			  </tr>

		  </table>
	  </el-dialog>
</div>
	  
  
  <script type="text/javascript" src="../../layuiadmin/js/case/case_law_initQuery.js"></script>
  
</body>
</html>